Back to Contents Previous Next
4. Variables & Strings
As was stressed in Section 1.2, the two files (DrWimp and !RunImage) work as a pair.
One of the implications of this is that any variables that are created in one of the files will be available to both files, unless the variables are made ‘local’.
This can be both an advantage and a disadvantage. For instance, it would be a problem if you created a variable in the !RunImage which - unknown to you - is also used in the DrWimp library and might therefore change the variable’s value unexpectedly.
This potential problem has been largely overcome by localising most of the variables used in DrWimp. However, there are some variables in the DrWimp library that cannot be localised for one reason or another (i.e. they are ‘global’ variables). In all but two of these cases the global variables in the DrWimp library have been given names that start with a lower case “w”.
So the simple rule is: when you create variable names yourself, don’t start them with a “w”. (It also makes sense to localise them wherever feasible.)
The exceptions are two global variables which have been specifically designed to be changed by the programmer and do not follow the naming rule above. They are NULL%
and UNUSED%
and are both set to their default value of FALSE
within FNwimp_initialise
. The use of these variables by the programmer is covered later - in Section 2.26 and 2.30 respectively.
Top of page Back to Contents Previous Next